﻿var dom = fl.getDocumentDOM();
var newSel = [];
var lib = dom.library;
var sellib = lib.getSelectedItems()[0];
newSel = dom.selection;

var type = sellib.itemType;
 
if( type == "movie clip" || type == "graphic" || type == "button" || type == "video" || type == "bitmap" )
{
	for( i=0; i<dom.selection.length; i++ )
	{
		var item = dom.selection[ i ];
		dom.swapElement( sellib.name );
	}
}
else
{
	alert( "PLEASE SELECT A VALID LIBRARY ITEM TO SWAP.\nVALID ITEMS ARE MOVIECLIPS, GRAPHICS, BITMAPS, VIDEOS, AND BUTTONS" );
}